package com.kcloud.commons.authorization.settings.biz.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.kcloud.commons.entity.control.AttributeGroup;
import com.kcloud.commons.entity.control.Operation;
import com.kcloud.commons.entity.core.StandardAttribute;
import lombok.Data;

import java.beans.Transient;
import java.util.Arrays;
import java.util.List;

/**
 * 业务功能
 * @author songhuiqing
 */
@TableName("@@BIZ_FUNCTION@@")
@Data
public class BizFunction extends BaseClob implements StandardAttribute {

    @TableId(type = IdType.ID_WORKER_STR)
    private String configId;// 业务功能配置id
    private String bizEntityId;//业务实体id
    private String bizDomainCode;// 业务域编码
    private String funcName; // 功能名称
    private String funcCode; // 功能编码


    public BizFunction() {}
    public BizFunction(String configId, String bizDomainCode, String operationText, String attributeText) {
        this.configId = configId;
        this.bizDomainCode = bizDomainCode;
        super.setAttributeText(attributeText);
        super.setOperationText(operationText);
    }

    @Override
    public void setId(String id) {
        this.configId = id.toString();
    }

    @Override
    public void setTitle(String title) {
        this.funcName = title;
    }

    @Transient
    @Override
    public String getId() {
        return this.configId;
    }

    @Override
    public String getTitle() {
        return this.funcName;
    }

}
